package com.how2java.tmall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.how2java.tmall.mapper.ProductimageMapper;
import com.how2java.tmall.pojo.Productimage;
import com.how2java.tmall.service.ProductImageService;

@Service
public class ProductImageServiceImpl implements ProductImageService{
	@Autowired
	private ProductimageMapper dao;
	
	
	@Override
	public void add(Productimage pi) {
		dao.insertSelective(pi);
	}

	@Override
	public void delete(int id) {
		dao.deleteByPrimaryKey(id);
		
	}

	@Override
	public void update(Productimage pi) {
		dao.updateByPrimaryKeySelective(pi);
	}

	@Override
	public Productimage get(int id) {
		
		return dao.selectByPrimaryKey(id);
	}

	@Override
	public List<Productimage> list(int pid, String type) {
		List<Productimage> list = dao.getProductimageByPidAndType(pid,type);
		
		
		return list;
	}

}
